#ifndef CVX_IMGFEATURES_H
#define CVX_IMGFEATURES_H 1

#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/highgui/highgui_c.h"

/** FEATURE_OXFD <BR> FEATURE_LOWE */
enum cvFeatureType
{
	CVX_FEATURE_OXFD,
	CVX_FEATURE_LOWE,
};

/** FEATURE_FWD_MATCH <BR> FEATURE_BCK_MATCH <BR> FEATURE_MDL_MATCH */
enum cvFeatureMatchType
{
	CVX_FEATURE_FWD_MATCH,
	CVX_FEATURE_BCK_MATCH,
	CVX_FEATURE_MDL_MATCH,
};

/** max feature descriptor length */
#define CVX_FEATURE_MAX_D 128

#define CVX_FEATURE_LOWE_COLOR CV_RGB(255,0,255)


/**
Structure to represent an affine invariant image feature.  The fields
x, y, a, b, c represent the affine region around the feature:

a(x-u)(x-u) + 2b(x-u)(y-v) + c(y-v)(y-v) = 1
*/
struct CvxFeature
{
	double x;                      /**< x coord */
	double y;                      /**< y coord */
	double a;                      /**< Oxford-type affine region parameter */
	double b;                      /**< Oxford-type affine region parameter */
	double c;                      /**< Oxford-type affine region parameter */
	double scl;                    /**< scale of a Lowe-style feature */
	double ori;                    /**< orientation of a Lowe-style feature */
	int d;                         /**< descriptor length */
	double descr[CVX_FEATURE_MAX_D];   /**< descriptor */
	int type;                      /**< feature type, OXFD or LOWE */
	int category;                  /**< all-purpose feature category */
	struct CvxFeature* fwd_match;     /**< matching feature from forward image */
	struct CvxFeature* bck_match;     /**< matching feature from backmward image */
	struct CvxFeature* mdl_match;     /**< matching feature from model */
	CvPoint2D64f img_pt;           /**< location in image */
	CvPoint2D64f mdl_pt;           /**< location in model */
	void* feature_data;            /**< user-definable data */	
};



#endif